import React from 'react'
import styles from './style/index.module.css'

const Loading = ({
  className,
  tip,
}: { className?: string; tip?: string }) => (
  <div className={styles['v-global-loading-container']}>
    <div className={styles['v-global-loading-icon']}>
      <svg className={className} viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg"
        width="200" height="200"
      >
        <path
          d="M512 64c247.2 0 448 200.8 448 448h-64c0-212-172-384-384-384V64z m0 832c-212 0-384-172-384-384H64c0 247.2 200.8 448 448 448v-64z"
        />
      </svg>
    </div>
    {tip && <div className={styles['v-global-loading-tip']}>{tip}</div>}
  </div>
)

export default Loading
